package com.qf.blogsystem.service;

import com.qf.blogsystem.core.service.BaseService;
import com.qf.blogsystem.entity.User;

import java.util.List;

/**
 * @author Crazy
 * @version 1.0
 * @description: 用户业务层接口
 * @date 2022/12/6 0:45
 */
public interface UserService extends BaseService<User> {
    /**
     * 根据激活码查询用户信息
     * @param activationCode
     * @return User
     * @throws Exception
     */
    User byActivationCode(String activationCode) throws Exception;

    /**
     * 用户登录验证
     * @param username
     * @param password
     * @return User
     * @throws Exception
     */
    User login(String username,String password)  throws Exception;

    /**
     * 更改头像
     * @param id
     * @param filePath
     * @throws Exception
     */
    boolean updateHeaderUrl(Integer id, String filePath) throws Exception;

    /**
     * 根据用户名查询用户信息
     * @param user
     * @return User
     */
    User byUsername(User user) throws Exception;

    /**
     * 根据邮箱查询用户信息
     * @param user
     * @return User
     * @throws Exception
     */
    User byEmail(User user) throws Exception;
}
